home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / bbs / l2100.zip / CASTLE4.REF < prev    next >
Text File  |  1997-06-23  |  13KB  |  731 lines

  1. ;note to .ref masters:
  2. ;replace castle4 with something else to use this .ref for other dwellings
  3. ;this .ref uses no long term vars, instead it makes its own data file - this
  4. ;means upgrading the game will not make people 'lose ownership' of their
  5. ;stuff.
  6. @#TOY
  7. @do moveback
  8. @do saybar
  9. Ahh... your private restroom.  Could life get any better?
  10.  
  11. @#MYBANK
  12. ;team treasury
  13. @do moveback
  14. @do `p20 is 0
  15. @if tres4.dat exist true then do
  16.   @begin
  17.   @readfile tres4.dat
  18. `p20
  19.   @
  20.   @end
  21.  
  22. @clearblock 20 21
  23. @do move 3 21
  24. @do write
  25. `r0`2  Treasury is at `$$`p20`2 - (`0T`2)ake, (`0L`2)eave or (`0N`2)evermind? [`0N`2] :`%`x
  26. @do readspecial `s01 NTL
  27. @if `s01 is N then do
  28.  @begin
  29.  @do saybar
  30. You close the safe, carefully.
  31.  @closescript
  32.  @end
  33.  
  34. @if `s01 is T then do
  35.   @begin
  36.   @do move 5 23
  37.   @do write
  38. `0`r0Amount? `0: `%
  39.  @do readnum 10 0
  40.   @do `p21 is `v40
  41.   @if `p21 < 1 then `p21 is 0
  42.   @if `p21 > `p20 then do
  43.     @begin
  44.     @clearblock 21 24
  45.     @do saybar
  46. Not enough in here for that.
  47.     @closescript
  48.     @end
  49.  
  50.  @if `p21 is 0 then do
  51.    @begin
  52.     @clearblock 21 24
  53.     @do saybar
  54. You take nothing.
  55.     @closescript
  56.    @end
  57. //withdrawl.. we read from the file again so cheating won't be possible with
  58. //correct timing
  59.   @readfile tres4.dat
  60. `p20
  61.   @
  62.  
  63.   @if `p20 < `p21 then do
  64.     @begin
  65.     @clearblock 21 24
  66.     @do saybar
  67. Oh no!  Someone took the money while you were thinking about it!
  68.     @closescript
  69.     @end
  70.  
  71.     @do `p20 - `p21
  72.     @do money + `p21
  73.   @do delete tres4.dat
  74.   @writefile tres4.dat
  75. `p20
  76.   @
  77.     @clearblock 21 24
  78.     @do saybar
  79. `2You take `$`p21`2 from the treasury.
  80.  
  81. //if not owner, lets notify him
  82.  
  83. @readfile castle4.dat
  84. `p20
  85. `s01
  86. @
  87. ;load owner and current password
  88.  
  89. @if `p20 not &playernum then do
  90.   @begin
  91.    @writefile mail\mail`p20.dat
  92.   `0Sosen Inn Reports:
  93. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  94. `0  `n`2 has taken `$$`p21 `2from the treasury.
  95.  
  96.   @end
  97.   @closescript
  98.   @end
  99.  
  100. @if `s01 is L then do
  101.   @begin
  102.   @do move 5 23
  103.   @do write
  104. `0`r0Amount? `0: `%
  105.  @do readnum 10 &money
  106.   @do `p21 is `v40
  107.   @if `p21 < 1 then `p21 is 0
  108.   @if `p21 > money then do
  109.     @begin
  110.     @clearblock 21 24
  111.     @do saybar
  112. You are not carrying that much!
  113.     @closescript
  114.     @end
  115.  
  116.  @if `p21 is 0 then do
  117.    @begin
  118.     @clearblock 21 24
  119.     @do saybar
  120. You decide to leave nothing.  Ha!
  121.     @closescript
  122.    @end
  123.  
  124.   @do money - `p21
  125.  
  126. //deposit.. we read from the file again so cheating won't be possible with
  127. //correct timing
  128.   @readfile tres4.dat
  129. `p20
  130.   @
  131.   @do `p20 + `p21
  132.   @do delete tres4.dat
  133.   @writefile tres4.dat
  134. `p20
  135.   @
  136.     @clearblock 21 24
  137. //if not owner, lets notify him
  138.  
  139. @readfile castle4.dat
  140. `p20
  141. `s01
  142. @
  143. ;load owner and current password
  144.  
  145. @if `p20 not &playernum then do
  146.   @begin
  147.    @writefile mail\mail`p20.dat
  148.   `0Sosen Inn Reports:
  149. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  150. `0  `n`2 has deposited `$$`p21 `2to the treasury.
  151.  
  152.   @end
  153.  
  154.  
  155.     @do saybar
  156. `2You leave `$`p21`2 in the treasury.
  157.   @closescript
  158.  
  159.  
  160.   @end
  161.  
  162.  
  163. @#priv
  164. @do moveback
  165. @do saybar
  166. Ahhh!  The private bedroom!  Nothing can hurt you here.
  167.  
  168. @#innkeeper
  169.  
  170.  
  171. @do moveback
  172.  
  173. @if castle4.dat exist false then do
  174.   @begin
  175.   @closescript
  176.   @end
  177.  
  178. @readfile castle4.dat
  179. `p20
  180. `s01
  181. @
  182.  
  183. @if `p20 is &playernum then do
  184.   @begin
  185.   @do moveback
  186.   @do saybar
  187. `0Innkeeper: `2Greetings, s&sir!
  188.   @closescript
  189.   @end
  190.  
  191.  
  192.  
  193. @if castle4a.dat exist false then do
  194.   @begin
  195.   @writefile castle4a.dat
  196. 200
  197. 0
  198.   @
  199.   @end
  200.  
  201.   @readfile castle4a.dat
  202. `p26
  203. `p27
  204.   @
  205.  
  206.  
  207. @do `v01 is 1
  208. @show
  209. `r0`c  `r1  `%Getting a room  `r0
  210.  
  211. `2  The Innkeeper looks at you.  `0"Kin I getcha a room?  Today it costs
  212.   only `$$`p26!`2"
  213.  
  214. @do write
  215. `x`x
  216. @choice
  217. Yeah, what a great deal.
  218. Shyeah, right.
  219. @if responce is 1 then do
  220.   @begin
  221.   @if money < `p26 then do
  222.     @begin
  223.     @show
  224. `\`\  `2You sort of lack the funds right now.  Looks like you're sleeping
  225.   outside...
  226.  
  227. `k
  228.    @do goto innkeeper
  229.    @end
  230.  
  231.   @do money - `p26
  232.   @do `p27 + `p26
  233.   @do delete castle4a.dat
  234.   @writefile castle4a.dat
  235. `p26
  236. `p27
  237.   @
  238.    @writefile mail\mail`p20.dat
  239.   `0Business note:
  240. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  241. `0  `n`2 has stayed at your Inn!  Cha-CHING!
  242.  
  243.   @do y - 3
  244.   @drawmap
  245.   @update
  246.   @do saybar
  247. `0Bartender:  `2"Great!  Go upstairs and pick out a bed!"
  248.   @closescript
  249.   @end
  250.  
  251. @drawmap
  252. @update
  253.  
  254. @#pass1
  255. @readfile castle4.dat
  256. `p20
  257. `s01
  258. @if `p20 is &playernum then do
  259.   @begin
  260.   @closescript
  261.   @end
  262.  
  263. @if &lasty is 11 then do
  264.   @begin
  265.   @do moveback
  266.   @do saybar
  267. `0Innkeeper:  `2You need to pay me before you can go back there.
  268.   @end
  269.  
  270. @#pass2
  271. @if castle4.dat exist false then do
  272.   @begin
  273.   @closescript
  274.   @end
  275.  
  276. @if &lastx is 58 then do
  277.   @begin
  278.   @closescript
  279.   @end
  280.  
  281. @readfile castle4.dat
  282. `p20
  283. `s01
  284. @if `p20 is &playernum then do
  285.   @begin
  286.   @closescript
  287.   @end
  288.  
  289. @do moveback
  290.  
  291.   @do `s02 is getname `p20
  292.   @do upcase `s01
  293.   @if `s01 is NONE then do
  294.    @begin
  295.   @do moveback
  296.   @do saybar
  297. `0Innkeeper:  `2No one is allowed over there.. it's private.
  298.  
  299.    @closescript
  300.    @end
  301.  
  302.   @show
  303. `r0`c  `r1 Entrance to the private area `r0
  304.  
  305. `2  `2The Innkeeper looks over at you.  `0"Hey!  What business do you have
  306.   going in there?"
  307.  
  308. @do write
  309. `x`x
  310. @do `v01 is 1
  311. @choice
  312. Offer an explanation
  313. Nevermind
  314.   @if response is 1 then do
  315.    @begin
  316.    @do write
  317. `\`\  `2Say what? :`x
  318.   @do readstring 40 NIL `s03 
  319.   @do upcase `s03
  320.   @do upcase `s01
  321.  
  322.   @if `s03 is `s01 then do
  323.     @begin
  324.     @show
  325. `\`\  `0"Ok, go on in then!"`\`\`k
  326.     @do x + 1
  327.     @drawmap
  328.     @update
  329.     @closescript
  330.     @end
  331.    @writefile mail\mail`p20.dat
  332.   `0Inkeeper Reports:
  333. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  334. `0  `n`2 attempted to get to the private bedroom by saying
  335.   `0"`s03"`2.  `2He was `bNOT`2 allowed in.
  336.  
  337.    @show
  338. `\`\  `2The Innkeeper isn't impressed.`\`\`k
  339.    @do moveback
  340.    @do goto done
  341.    @end
  342.  
  343.   @do goto done
  344.  
  345.  
  346.  @#done
  347.  @drawmap
  348.  @update
  349.  
  350. @#doorguard
  351. @do moveback
  352. @label startg
  353. ;guy who owns on it pushes against the door guard symbol.  This lets him
  354. ;control the password to gain entrance to the castle, as well as sell it
  355. ;back or transfer ownership.
  356.  
  357. @if castle4a.dat exist false then do
  358.   @begin
  359.   @writefile castle4a.dat
  360. 200
  361. 0
  362.   @end
  363.  
  364.  
  365. @if castle4.dat exist false then do
  366.   @begin
  367.   @do saybar
  368. `0"Get out please!  The Inn has been sold!" `2the Innkeeper commands.
  369.  @closescript
  370.   @end
  371.  
  372. @readfile castle4.dat
  373. `p20
  374. `s01
  375. @
  376.  
  377.   @readfile castle4a.dat
  378. `p26
  379. `p27
  380.   @
  381.  
  382.  
  383. ;load owner and current password
  384.  
  385. @if `p20 not &playernum then do
  386.   @begin
  387.   @do saybar
  388. You wave to the Innkeeper.
  389.   @closescript
  390.   @end
  391. @busy
  392.  
  393.  
  394. @do `v01 is 1 ;set default choice to 1
  395. @show
  396. `r0`c  `r1 Instructing your servants `r0
  397.  
  398.   `2The Innkeeper stops working for a moment.
  399.  
  400. @do write
  401. `x`x
  402. @choice
  403. Set password to private bedroom. (currently is `0`s01`%)
  404. Ownership options
  405. Set inn fee (currently is at `$$`p26`%)
  406. Take money from register
  407. Leave
  408. @
  409.  
  410. @if responce is 4 then do
  411.   @begin
  412.   @if `p27 < 1 then do
  413.    @begin  
  414. @show
  415. `\`\  `0"Before you look in that register.. lemmie tell you business has
  416.   been a little slow." `2the Innkeeper tells you.
  417.  
  418. `k  `$"How slow?" `2you ask.
  419.  
  420. `k  `0"Ok, we have not had a single customer since you last checked, ARE
  421.   YOU HAPPY NOW!?" `2the Innkeeper cries as he bursts into tears.
  422.  
  423. `k
  424.    @do goto doorguard
  425.    @end
  426.  
  427.  
  428.   @readfile castle4a.dat
  429. `p26
  430. `p27
  431.   @
  432.   @do money + `p27
  433.   @do delete castle4a.dat
  434.   @writefile castle4a.dat
  435. `p26
  436. 0
  437.   @
  438.  
  439.   @show
  440. `\`\  `2Sure, we've made `$$`p27`2, here ya go!
  441.  
  442. `k
  443.   @end
  444.  
  445. @if responce is 3 then do
  446.   @begin
  447.   @do write
  448. `\`\`x`xNew fee? :`x
  449.   @do readnum 10 `p26
  450.   @if `v40 < 0 then do
  451.     @begin
  452.     @show
  453. `\`\  `2Price set to `$$`v40`2.
  454.  
  455. `k  `2You think you're pretty smart, don't you.
  456.  
  457. @do `v01 is 1
  458. @do write
  459. `x`x
  460. @choice
  461. Yes, yes I do.  Now please give me 1,000,000 gold for free, I deserve it.
  462. No, you oh computer are the true master.  We humans suck.
  463. @if responce is 1 then do
  464.   @begin
  465.   @show
  466. `\`\  `2GET OUT OF HERE BEFORE I `bDELETE`2 YOU!  Next time I will.
  467.  
  468.   @do goto doorguard
  469.   @end
  470.  
  471. @if responce is 2 then do
  472.   @begin
  473.   @show
  474. `\`\  The computer playfully slaps your ass as it walks out.
  475.  
  476.   @do goto doorguard
  477.  
  478.   @end
  479.  
  480.     @do goto doorguard
  481.     @end
  482.   @readfile castle4a.dat
  483. `p26
  484. `p27
  485.   @
  486.   @do `p26 is `v40
  487.   @do delete castle4a.dat
  488.   @writefile castle4a.dat
  489. `p26
  490. `p27
  491.   @
  492.   @do goto doorguard
  493.   @end
  494.  
  495.  
  496.  
  497. @if responce is 2 then do
  498.  @begin
  499.  @show
  500. `r0`c  `r1 Ownership Options `r0
  501.  
  502.   `2You retrieve your deed and carefully look it over.
  503.    
  504.    @do `v01 is 1
  505.    @do write
  506. `x`x
  507.    @choice
  508. Transfer deed to someone else
  509. Sell property back to the bank for `$10000`%.
  510. Do nothing of the sort
  511.  @if response is 1 then do
  512.    @begin
  513.    @show
  514. `\`\  `2Transfer to whom?
  515.    @chooseplayer `p20
  516.  
  517.    @if `p20 is 0 then do
  518.     @begin
  519.     @show
  520.   `2You decide to keep your domain - for now.`\`\`k
  521.     @do goto startg
  522.     @end
  523.    @do `s02 is getname `p20
  524.    @show
  525. `2  Are you sure you wish to give your Inn to `0`s02`2?
  526. @do write
  527. `x`x
  528. @choice
  529. Yes
  530. Not on your life.
  531.  @if responce is 2 then do
  532.    @begin
  533.     @show
  534. `\`\  `2You decide to keep your domain - for now.`\`\`k
  535.     @do goto startg
  536.    @end
  537.  
  538.   @do delete castle4.dat
  539.   @writefile castle4.dat
  540. `p20
  541. `s01
  542. 0
  543. 0
  544. 0
  545. 0
  546.    @writefile mail\mail`p20.dat
  547.   `0Business note:
  548. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  549. `0  `n`2 has transferred ownership of Sosen Inn to you. 
  550.   Password to enter bedroom will remain `0"`s01"`2 unless
  551.   `2you come by and change it.
  552.  
  553.     @do addlog
  554.   `0`n`2 has given `%Sosen Inn`2 to `0`s02`2!
  555.      @routine seperate in gametxt.ref
  556.  
  557.     @show
  558. `\`\  `2Deed transfered.  Oh well - it was fun while it lasted.`\`\`k
  559.    @do goto done
  560.    @end
  561.   @if response is 2 then do
  562.     @begin
  563.     @show
  564. `\`\`2  Are you sure you wish to sell your Inn back to the bank?`\
  565. @do `v01 is 1
  566. @do write
  567. `x`x
  568. @choice
  569. Yes
  570. Not on your life.
  571.  @if responce is 2 then do
  572.    @begin
  573.     @show
  574. `\`\  `2You decide to keep your domain - for now.`\`\`k
  575.     @do goto startg
  576.    @end
  577.  
  578.   @do delete castle4.dat
  579.   @do delete castle4a.dat
  580.   @do money + 10000
  581.   @show
  582. `\`\  `%INN SOLD!`2`\`\`k
  583.     @do addlog
  584.   `0`n`2 has sold `%Sosen Inn`2 back to the bank!
  585.     @routine seperate in gametxt.ref
  586.     @do goto done
  587.     @end
  588.  
  589.  
  590.   @do goto startg
  591.  @end
  592.  
  593. @if responce is 1 then do
  594.   @begin
  595.   @do write
  596. `\`\  `0"And the new password, s&sir?" `2(enter `4NONE`2 for no access to anyone)`\  `2Password:`x
  597.   @do readstring 40 `s01 `s01 
  598.   @do `p20 is length `s01
  599.   @if `p20 < 2 then do
  600.    @begin
  601.    @show
  602. `\`\  `2You decide the current password is ok.`\`\`k
  603.    @do goto startg
  604.    @end
  605.   @do delete castle4.dat
  606.   @writefile castle4.dat
  607. &playernum
  608. `s01
  609. 0
  610. 0
  611. 0
  612. 0
  613. @show
  614. `\`\  `0"Yes s&sir, I will not forget it!" `2the Innkeeper promises.`\`\`k
  615.    @do goto startg
  616.   @end
  617.  
  618. @drawmap
  619. @update
  620.  
  621. @#sign
  622. @do moveback
  623.  
  624.  @if castle4.dat exist false then do
  625.  @begin
  626.  @do saybar
  627. Sosen Inn - For sale cheap, enquire inside.
  628.  @end 
  629.  
  630. @if castle4.dat exist true then do
  631.  @begin
  632. @readfile castle4.dat
  633. `p20
  634. `s01
  635. @
  636. @do `s01 is getname `p20
  637.  @do saybar
  638. `2Property of `0`s01`2.
  639.  @end 
  640.  
  641. @#enter
  642. @do moveback
  643. @offmap
  644.  
  645.  
  646. @if castle4.dat exist false then do
  647.   @begin
  648.   @show
  649. `r0`c  `r1 `%For Sale `r0
  650.  
  651.   `2Sosen Inn - money making opportunity.  Buy it now, only asking
  652.   `$$20,000`2.
  653.   
  654.   Buy now and recieve the following bonuses:
  655.  
  656.   `0* `2Private area for you
  657.  
  658.   `0* `2Upstairs for your guests - you can set any price you want
  659.  
  660. @do `v01 is 1
  661. @do write
  662. `x`x
  663. @choice
  664. >&money 19999 Purchase it.
  665. <&money 20000 Sigh wistfully and leave since you don't have enough.
  666. >&money 19999 Leave.
  667. @
  668.  
  669. @if responce is 1 then do
  670.   @begin
  671.   @if castle4.dat exist true then do
  672.     @begin
  673.     @show
  674. `\`\  `2Oh crap!  Someone bought it while you were thinking about it.  You
  675.   will regret your snail like thinking for the rest of your days.`\`\`k
  676.     @do goto done
  677.     @end
  678.  
  679.   @writefile castle4.dat
  680. &playernum
  681. NONE
  682. 0
  683. 0
  684. 0
  685. 0
  686.     @do money - 20000
  687.     @do addlog
  688.   `0`n `2buys `%Sosen Inn`2!
  689.      @routine seperate in gametxt.ref
  690.  
  691.   @show
  692. `r0`c  `r1 `%Why hello there, landowner! `r0
  693. `\`2  Nice job!  You now own this Inn!
  694.  
  695.   `2Enjoy your new home.`\`\`k
  696.   @end
  697.  
  698. @label done
  699. @drawmap
  700. @update
  701. @closescript
  702.   @end
  703.  
  704. @readfile castle4.dat
  705. `p20
  706. `s01
  707. @
  708.  
  709. @do `p21 is deleted `p20
  710.  
  711. @if `p21 is 1 then do
  712.   @begin
  713.    ;owner got deleted!!!  Lets put it up for sale again.
  714.    @do delete castle4.dat
  715.     @do addlog
  716.   `%Sosen Inn`2 is put on the market today.
  717.      @routine seperate in gametxt.ref
  718.  
  719.    ;run script again
  720.    @do goto enter
  721.   @end
  722.  
  723. ;let him in
  724. @label letmein
  725. @do x is 51
  726. @do y is 12
  727. @do map is 616
  728. @loadmap &map
  729. @do goto done
  730. @#done
  731.